<?php if (!defined('ABSPATH')) die('not allowed');

//this class extends PHPMailer and offers some fixes

if(!class_exists('PHPMailer')) require_once MYMAIL_DIR . '/classes/libs/phpmailer/class.phpmailer.php';
if(!class_exists('SMTP')) require_once MYMAIL_DIR . '/classes/libs/phpmailer/class.smtp.php';

class mymail_mail_helper extends PHPMailer {



	public function __construct($exceptions = false) {
		$this->XMailer = 'MyMail ' . MYMAIL_VERSION . ' by revaxarts.com (http://rxa.li/mymail)';
		parent::__construct( $exceptions );
	}
	
	public static function ValidateAddress($address) {
		return mymail_is_email($address);
	}
	public function PreSend() {
		try{
		
			return parent::PreSend();
			
		} catch (phpmailerException $e) {
			$this->SetError($e->getMessage());
			if ($this->exceptions) {
				throw $e;
			}
			return false;
		}
		
	}
	
	

}

class mailerException extends Exception {
}
?>